﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Polaris.Domain.Model.DbEntity
{
    /// <summary>
    /// 统一留言表，type区分功能模块
    /// </summary>
    public class UnifyMessage
    {
        /// <summary>
        /// 主键
        /// </summary>
        [Key]
        [Comment("主键")]
        public Guid Id { get; set; }

        /// <summary>
        /// 父级id 顶条评论的id
        /// </summary>
        [Comment("父级id 顶条评论的id"),MaxLength(50)]
        public Guid? ParentId { get; set; }

        /// <summary>
        /// 回复id
        /// </summary>
        [Comment("回复的id")]
        public Guid? ReplyId { get; set; }

        /// <summary>
        /// 评论类型 1文章，2恋爱日记留言，3悄悄话评论，4自述留言，5此站点留言，6树洞留言
        /// </summary>
        [Comment("评论类型 1文章，2恋爱日记留言，3悄悄话评论，4自述留言，5此站点留言，6树洞留言")]
        public int MessageType { get; set; }

        /// <summary>
        /// 外键id 例如文章id
        /// </summary>
        [Comment("外键id 例如文章id")]
        public Guid? TypeId { get; set; }

        /// <summary>
        /// 用户名称
        /// </summary>
        [Comment("用户名称"), MaxLength(50)]
        public string UserName { get; set; }

        /// <summary>
        /// 用户邮箱
        /// </summary>
        [Comment("用户邮箱"), MaxLength(50)]
        public string UserEmail { get; set; }

        /// <summary>
        /// 用户网址
        /// </summary>
        [Comment("用户网址"), MaxLength(255)]
        public string? WebSite { get; set; }

        /// <summary>
        /// 评论内容
        /// </summary>
        [Comment("评论内容"),MaxLength(1024)]
        public string? Content { get; set; }

        /// <summary>
        /// 评论时间
        /// </summary>
        [Comment("评论时间")]
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 评论审核
        /// </summary>
        [Comment("评论审核")]
        public bool? Examine { get; set; }

        /// <summary>
        /// IP地址
        /// </summary>
        [Comment("IP地址"), MaxLength(255)]
        public string? IPAddress { get; set; }

        /// <summary>
        /// 评论者位置信息
        /// </summary>
        [Comment("评论者位置信息"), MaxLength(255)]
        public string? Position { get; set; }

        /// <summary>
        /// 评论者设备信息
        /// </summary>
        [Comment("评论者设备信息"), MaxLength(255)]
        public string? DeviceInfo { get; set; }

        /// <summary>
        /// 评论者浏览器（不精准）
        /// </summary>
        [Comment("评论者浏览器（不精准）"), MaxLength(255)]
        public string? Browser { get; set; }

        /// <summary>
        /// 是否匿名
        /// </summary>
        [Comment("是否匿名")]
        public bool? Anonymous { get; set; }

        /// <summary>
        /// 更新人
        /// </summary>
        [Comment("更新人")]
        public Guid? UpdateBy { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        [Comment("更新时间")]
        public DateTime? UpdateTime { get; set; }
    }
}
